﻿CREATE PROCEDURE [dbo].[yaf_smiley_listunique](
                @BoardID INT)
AS
    BEGIN
        SELECT   Icon,
                 Emoticon,
                 Code = (SELECT TOP 1 Code
                         FROM   yaf_Smiley x
                         WHERE  x.Icon = yaf_Smiley.Icon)
        FROM     yaf_Smiley
        WHERE    BoardID = @BoardID
        GROUP BY Icon,Emoticon
        ORDER BY Code
    END


